package com.patterns.builder;

/**
 * 游戏地图实体，针对不同构造器构建出不同地图
 * @author huangke
 *
 */
public class GameMap {
	private Tree tree;
	private Weather weather;
	private Temperature temperature;
	//运行地图
	public void run(){
		System.out.println("创建了一张地图:"+this.tree.getColor()+"色的树,天气"+this.weather.getWeather()+",温度"+this.temperature.getTemperature()+"℃");
	}
	public Tree getTree() {
		return tree;
	}
	public void setTree(Tree tree) {
		this.tree = tree;
	}
	public Weather getWeather() {
		return weather;
	}
	public void setWeather(Weather weather) {
		this.weather = weather;
	}
	public Temperature getTemperature() {
		return temperature;
	}
	public void setTemperature(Temperature temperature) {
		this.temperature = temperature;
	}
}

//树
class Tree{
	private String color;

	public Tree(String color) {
		this.color = color;
	}
	public String getColor() {
		return color;
	}
	public void setColor(String color) {
		this.color = color;
	}
}

//天气
class Weather{
	private String weather;
	
	public Weather(String weather) {
		this.weather = weather;
	}
	public String getWeather() {
		return weather;
	}
	public void setWeather(String weather) {
		this.weather = weather;
	}
}

//温度
class Temperature{
	private int temperature;

	public Temperature(int temperature) {
		this.temperature = temperature;
	}
	public int getTemperature() {
		return temperature;
	}
	public void setTemperature(int temperature) {
		this.temperature = temperature;
	}
}
